package com.framework.modules.job.task.yhbtask;

import com.framework.entity.tran.TranTransactionInfo;
import com.framework.service.yhbservice.YhbTransactionService;
import com.framework.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;

@Component("addTransactionTask")
public class AddTransactionTask {


    @Autowired
    private YhbTransactionService yhbTransactionService;

    public void addinfo(){
        String sn="V3248892430";

        Date date=DateUtils.stringToDate("2019-04-01",DateUtils.DATE_PATTERN);

        for (int i=0;i<=2;i++){
            date= DateUtils.addDateMonths(date,i);
            for (int j=0;j<=400;j++){

                TranTransactionInfo info=new TranTransactionInfo();
                info.setKaolaType(1);
                info.setIsVip("否");
                info.setSn(sn);
                info.setCreateDate(new Date());
                info.setTransactionDate(date);
                info.setTerminalType(10);
                info.setAmount(new BigDecimal(1000));
                info.setDeptId(1L);
                info.setMerchantCode(sn);
                yhbTransactionService.insert(info);
            }

        }



    }


}
